import { createStore } from 'vuex'
export default createStore({
  state:{
   playList:[{
   al:{
     id: 39483040,
     name: "平凡的一天",
     pic: 109951163350929740,
     picUrl: "http://p3.music.126.net/vmCcDvD1H04e9gm97xsCqg==/109951163350929740.jpg",
     pic_str: "109951163350929740"
     },
     id: 569213220,
     name:'像我这样的人',
     show:false,   
     ar:[{name:"毛不易"}],
   },
   ],
   playListindex:0,
   zhangting:true,
   gechi:{},
   settime:0,
   duration:0,
   search2:[],
   bottomshow:true
  },
  getters: {
  },
  mutations: {
    getMusic(state,items)
    {
    //  if(state.playList.length!=1)
    //  state.playList.length=1
    // items.filter(item=>{
    //   state.playList.push(item) 
    
    // })
     state.playList=items 
    // state.playListindex=state.tronls
    console.log(state.playList)
    },
    setindex(state,index)
    {
      state.playListindex=index
    },
    seticon(state,bool)
    {
    state.zhangting=bool
    },
    bjshow(state,value)
    {
      state.show=value
    },
    setgechi(state,value)
    {
      state.gechi=value
    },
    Thesettime(state,value)
    {
      state.settime=value
    },
    upduration(state,value)
    {
      state.duration=value
    },
    bjbottomshow(state,val)
    {
      state.bottomshow=val
    }
    // getsearchMusic(state,val)
    // {
    //   // state.search2.push(val)
    //   // state.playList=state.search2
    //   state.playList.push(val)
    // }
  },
  actions: {
  },
  modules: {
  }
})
